package com.syh.jn.scm.infrastructure.repository.model.finance;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 收款单
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "T_FINANCE_RECEIPT_BILL")
@EqualsAndHashCode(callSuper = true)
public class ReceiptBillModel extends SuperBusinessModel {
  /**
   * 收款单编号
   */
  @Column(name = "CODE", columnDefinition = "varchar(50) COMMENT '收款单编号'")
  private String code;
  /**
   * 对账单id
   */
  @Column(name = "STATEMENT_OF_ACCOUNT_ID", columnDefinition = "bigint COMMENT '对账单id'")
  private Long statementOfAccountId;
  /**
   * 客户类型: 0上游, 1下游, 2物流
   */
  @Column(name = "CUSTOMER_TYPE", columnDefinition = "smallint COMMENT '客户类型: 0上游, 1下游, 2物流'")
  private Short customerType;
  /**
   * 锁定状态(0 未锁定 1 已锁定 )双方确认后自动锁定，锁定后为最终状态，将不可再修改
   */
  @Column(name = "LOCK_STATUS", columnDefinition = "smallint COMMENT '锁定状态(0 未锁定 1 已锁定 )'")
  private Short lockStatus;
  /**
   * 收款单状态:0未到账, 1已到账
   */
  @Column(name = "RECEIPT_STATE", columnDefinition = "smallint COMMENT '收款单状态:0未到账, 1已到账'")
  private Short receiptState;
  /**
   * 录单人id
   */
  @Column(name = "BROKERAGE_ID", columnDefinition = "bigint COMMENT '录单人id'")
  private Long brokerageId;
  /**
   * 客户id
   */
  @Column(name = "CUSTOMER_ID", columnDefinition = "bigint COMMENT '客户id'")
  private Long customerId;
  /**
   * 我方开户行
   */
  @Column(name = "OUR_ACCOUNT_BANK", columnDefinition = "varchar(50) COMMENT '我方开户行'")
  private String ourAccountBank;
  /**
   * 我方开户支行
   */
  @Column(name = "OUR_ACCOUNT_BRANCH_BANK", columnDefinition = "varchar(50) COMMENT '我方开户支行'")
  private String ourAccountBranchBank;
  /**
   * 我方开户账号
   */
  @Column(name = "OUR_ACCOUNT_BANK_CODE", columnDefinition = "varchar(100) COMMENT '我方开户账号'")
  private String ourAccountBankCode;
  /**
   * 我方地址省 市 区
   */
  @Column(name = "OUR_AREA", columnDefinition = "varchar(300) COMMENT '我方地址省 市 区 使用[广东省,广州市,海珠区]格式保存'")
  private String ourArea;
  /**
   * 我方支行地址
   */
  @Column(name = "OUR_BRANCH_BANK_ADDRESS", columnDefinition = "varchar(100) COMMENT '我方支行地址'")
  private String ourBranchBankAddress;
  /**
   * 上游或下游开户行
   */
  @Column(name = "OTHER_PARTY_ACCOUNT_BANK", columnDefinition = "varchar(50) COMMENT '上游或下游开户行'")
  private String otherPartyAccountBank;
  /**
   * 上游或下游开户支行
   */
  @Column(name = "OTHER_PARTY_ACCOUNT_BRANCH_BANK", columnDefinition = "varchar(50) COMMENT '上游或下游开户支行'")
  private String otherPartyAccountBranchBank;
  /**
   * 上游或下游开户账号
   */
  @Column(name = "OTHER_PARTY_ACCOUNT_BANK_CODE", columnDefinition = "varchar(100) COMMENT '上游或下游开户账号'")
  private String otherPartyAccountBankCode;
  /**
   * 上游或下游地址省 市 区
   */
  @Column(name = "OTHER_PARTY_AREA", columnDefinition = "varchar(300) COMMENT '上游或下游地址省 市 区 使用[广东省,广州市,海珠区]格式保存'")
  private String otherPartyArea;
  /**
   * 上游或下游支行地址
   */
  @Column(name = "OTHER_PARTY_BRANCH_BANK_ADDRESS", columnDefinition = "varchar(100) COMMENT '上游或下游支行地址'")
  private String otherPartyBranchBankAddress;
  /**
   * 收款金额
   */
  @Column(name = "PRICE", columnDefinition = "decimal(19,2) COMMENT '收款金额'")
  private BigDecimal price;
  /**
   * 收款日期
   */
  @Column(name="INPUT_TIMESTAMP" , columnDefinition=("bigint COMMENT '收款日期'"))
  private Long inputTimestamp;
  /**
   * 银行流水号
   */
  @Column(name = "BANK_STATEMENT", columnDefinition = "varchar(50) COMMENT '银行流水号'")
  private String bankStatement;
  /**
   * 备注
   */
  @Column(name = "REMARK", columnDefinition = "varchar(100) COMMENT '备注'")
  private String remark;
  /**
   * 上游或下游确认是否到账：0未生效, 1已生效
   */
  @Column(name = "CONFIRM_STATE", columnDefinition = "smallint COMMENT '上游或下游确认生效状态:0未生效, 1已生效'")
  private Short confirmState;
  /**
   * 创建日期
   */
  @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
  private Long createTimeStamp;
  /**
   * 最后修改日期
   */
  @Column(name = "LAST_UPDATE_TIME_STAMP", columnDefinition = "bigint COMMENT '最后修改日期'")
  private Long lastUpdateTimeStamp;
}
